home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tex / macros / source / contrib / supported / feynmf / feynmf.sty < prev    next >
Text File  |  1995-03-15  |  11KB  |  286 lines

  1. %% 
  2. %% This is file `feynmf.sty', generated 
  3. %% on <1995/3/4> with the docstrip utility (2.2i).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% feynmf.dtx  (with options: `style')
  8. %% 
  9. %% Copyright (C) 1989, 1990, 1992-1995 by Thorsten.Ohl@Physik.TH-Darmstadt.de 
  10. %% 
  11. %% This file is NOT the source for feynmf, because almost all comments 
  12. %% have been stripped from it. It is NOT the preferred form of feynmf 
  13. %% for making modifications to it. 
  14. %% 
  15. %% Therefore you can NOT redistribute and/or modify THIS file. You can 
  16. %% however redistribute the complete source (feynmf.dtx and feynmf.ins) 
  17. %% and/or modify it under the terms of the GNU General Public License as 
  18. %% published by the Free Software Foundation; either version 2, or (at 
  19. %% your option) any later version. 
  20. %% 
  21. %% Feynmf is distributed in the hope that it will be useful, but 
  22. %% WITHOUT ANY WARRANTY; without even the implied warranty of 
  23. %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
  24. %% GNU General Public License for more details. 
  25. %% 
  26. %% You should have received a copy of the GNU General Public License 
  27. %% along with this program; if not, write to the Free Software 
  28. %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
  29. %% 
  30. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  31. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  32. %% \CheckSum{553}
  33. %% \CharacterTable
  34. %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  35. %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  36. %%   Digits        \0\1\2\3\4\5\6\7\8\9
  37. %%   Exclamation   \!     Double quote  \"     Hash (number) \#
  38. %%   Dollar        \$     Percent       \%     Ampersand     \&
  39. %%   Acute accent  \'     Left paren    \(     Right paren   \)
  40. %%   Asterisk      \*     Plus          \+     Comma         \,
  41. %%   Minus         \-     Point         \.     Solidus       \/
  42. %%   Colon         \:     Semicolon     \;     Less than     \<
  43. %%   Equals        \=     Greater than  \>     Question mark \?
  44. %%   Commercial at \@     Left bracket  \[     Backslash     \\
  45. %%   Right bracket \]     Circumflex    \^     Underscore    \_
  46. %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
  47. %%   Right brace   \}     Tilde         \~}
  48. %%
  49. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  50. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  51. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  52. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  53. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  54. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  55. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  56. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  57. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  58. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  59. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  60. \NeedsTeXFormat{LaTeX2e}
  61. {\def\RCS#1#2\endRCS{%
  62.   \ifx$#1%
  63.     \@RCS $#2 \endRCS
  64.   \else
  65.     \@RCS $*: #1#2$ \endRCS
  66.   \fi}%
  67.  \def\@RCS $#1: #2,v #3 #4 #5 #6$ \endRCS{%
  68.    \gdef\filename{#2}%
  69.    \gdef\fileversion{v#3}%
  70.    \gdef\filedate{#4}%
  71.    \gdef\docdate{#4}}%
  72. \RCS feynmf.dtx,v 1.10 1995/02/18 16:42:18 ohl Exp \endRCS}%
  73. \ProvidesPackage{feynmf}[\filedate\space LaTeX2e package]
  74. \typeout{Package: `feynmf'
  75.    \fileversion\space <\filedate> (tho) PRELIMINARY TEST RELEASE}
  76. \wlog{English documentation \@spaces<\docdate> (tho)}
  77. \let\mdqrestore\relax
  78. \@ifundefined{mdqoff}{}{%
  79.   \mdqoff
  80.   \let\mdqrestore\mdqon}
  81. \newwrite\@outfmf
  82. \def\fmfcmd#1{%
  83.   \immediate\write\@outfmf{#1}\ignorespaces}
  84. {\catcode`\%=11\gdef\p@rcent{%}}
  85. \edef\fmf@fileversion{\fileversion}
  86. \def\fmffile#1{%
  87.   \def\thefmffile{#1}%
  88.   \equaltojobname{\thefmffile}{%
  89.     \errhelp={The argument of \fmffile MUST NOT be identical to the^^J%
  90.               name of your main input file!  I will use fmfdefault.mf^^J%
  91.               this time around, but you'd better fix your code now!}%
  92.     \errmessage{Invalid arument of \string\fmffile!}%
  93.     \def\thefmffile{fmfdefault}}{}%
  94.   \immediate\openout\@outfmf=\thefmffile.mf\relax
  95.   \fmfcmd{\p@rcent\space \thefmffile.mf -- do not edit, %
  96.           generated automatically by \jobname.tex^^J%
  97.           input feynmf^^J%
  98.           require_RCS_revision "\expandafter\@gobble\fmf@fileversion";}%
  99.   \batchmode
  100.   \font\f@ynmf=\thefmffile
  101.   \errorstopmode
  102.   \ifx\f@ynmf\nullfont
  103.     \def\f@ynmf{feynmf character:}%
  104.     \typeout{%
  105.       feynmf: File \thefmffile.tfm not found:^^J%
  106.       feynmf: Process \thefmffile.mf with METAFONT and then %
  107.               reprocess this file.}%
  108.   \else
  109.     \typeout{%
  110.       feynmf: File \thefmffile.tfm found.^^J%
  111.       feynmf: Nevertheless, if the picture has changed, %
  112.               reprocess \thefmffile.mf.^^J%
  113.       feynmf: If dimension have changed, reprocess \thefmffile.mf %
  114.               and \jobname.tex.}%
  115.   \fi
  116.   \setcounter{fmfchar}{0}}
  117. \let\thefmffile\relax
  118. \newcounter{fmfchar}
  119. \def\equaltojobname#1#2#3{%
  120.   \edef\@tempa{#1}%
  121.   \edef\@tempa{\meaning\@tempa}%
  122.   \edef\@tempb{\jobname}%
  123.   \edef\@tempb{\meaning\@tempb}%
  124.   \ifx\@tempa\@tempb
  125.     #2
  126.   \else
  127.     #3
  128.   \fi}
  129. \def\endfmffile{%
  130.   \fmfcmd{\p@rcent\space the end.^^J%
  131.           end.^^J%
  132.           endinput;}%
  133.   \let\thefmffile\relax
  134.   \immediate\closeout\@outfmf}
  135. {\catcode`\#=11\gdef\sh@rp{#}}
  136. \def\fmf@char#1#2{%
  137.   \ifx\thefmffile\relax
  138.     \errhelp={Outside a fmffile environment, I have no clue as to where^^J%
  139.               the METAFONT commands should go.   I will use fmfdefault.mf^^J%
  140.               for this character, but you'd better fix your code!}%
  141.     \errmessage{I detected a fmfchar environment outside of fmffile}%
  142.     \fmffile{fmfdefault}
  143.   \fi
  144.   \global\expandafter\advance\csname c@fmfchar\endcsname \@ne
  145.   \fmfcmd{beginchar(\thefmfchar, #1*\the\unitlength\sh@rp, %
  146.                                  #2*\the\unitlength\sh@rp, 0);^^J%
  147.             "feynmf: \thefmfchar";}%
  148.   \fmfcmd{LaTeX_unitlength:=\the\unitlength;}%
  149.   \fmfinit
  150.   \fmfpen{thin}}
  151. \def\fmfchar(#1,#2){%
  152.   \fmf@char{#1}{#2}%
  153. {\f@ynmf \char\value{fmfchar}}%
  154.   \ignorespaces}
  155. \def\endfmfchar{%
  156.   \fmfposition
  157.   \fmfdraw
  158.   \fmfcmd{endchar;}}
  159. \@namedef{fmfchar*}(#1,#2){%
  160.   \begin{picture}(#1,#2)
  161.     \fmf@char{#1}{#2}%
  162.     {\catcode`\%=14\relax
  163.       \grepfile{%
  164.         \thefmffile.\thefmfchar}{%
  165.         \thefmffile.log}{%
  166.         \thefmffile.t\thefmfchar}}%
  167. \put(0,0){{\f@ynmf \char\value{fmfchar}}}%
  168.       \ignorespaces}
  169. \@namedef{endfmfchar*}{%
  170.     \endfmfchar
  171.     {\catcode`\%=14\relax
  172.       \InputIfFileExists{\thefmffile.t\thefmfchar}{}{%
  173.         \typeout{%
  174.           feynmf: Label file \thefmffile.t\thefmfchar\space not found:^^J%
  175.     feynmf: Process \thefmffile.mf with METAFONT and then %
  176.                   reprocess this file.}}}%
  177.   \end{picture}}
  178. \def\fmfframe(#1,#2)(#3,#4)#5{%
  179.   \leavevmode
  180.   \hbox{\vbox{\vskip#2\unitlength\par
  181.               \hbox{\hskip#1\unitlength#5\hskip#3\unitlength}\par
  182.               \vskip#4\unitlength}}}
  183. \def\fmfpen#1{\fmfcmd{pickup pencircle scaled #1;}}
  184. \def\grepfile#1#2#3{%
  185.   \begingroup
  186.     \edef\pattern{\csname*grep*#1*\endcsname}%
  187.     \immediate\openin\grep@infile #2\relax
  188.     \ifeof\grep@infile
  189.     \else
  190.       \grep@outopenfalse
  191.       \endlinechar=-1
  192.       \catcode`\\=12\relax
  193.       \loop
  194.         \read\grep@infile to \grep@lbuf
  195.         \ifeof\grep@infile
  196.           \grep@contfalse
  197.         \else
  198.           \grep@conttrue
  199.           \ifx\grep@lbuf\empty
  200.           \else
  201.             \expandafter\grep@aline\grep@lbuf\sentinel
  202.             \ifx\pattern\grep@tag
  203.               \ifgrep@outopen
  204.               \else
  205.                  \immediate\openout\grep@outfile #3\relax
  206.                  \immediate\write\grep@outfile{\p@rcent\space #3 %
  207.                     -- generated automatically from #2}%
  208.                  \immediate\write\grep@outfile{\p@rcent\space
  209.                     Think twice before editing THIS file!}%
  210.                  \grep@outopentrue
  211.               \fi
  212.               \immediate\write\grep@outfile{\grep@val}%
  213.             \fi
  214.           \fi
  215.         \fi
  216.       \ifgrep@cont
  217.       \repeat
  218.       \ifgrep@outopen
  219.         \immediate\closeout\grep@outfile
  220.       \fi
  221.     \fi
  222.     \immediate\closein\grep@infile
  223.   \endgroup}
  224. \newread\grep@infile
  225. \newwrite\grep@outfile
  226. \newif\ifgrep@cont
  227. \newif\ifgrep@outopen
  228. \def\grep@aline#1#2\sentinel{%
  229.   \ifx:#1%
  230.     \grep@splitlbuf#2\sentinel
  231.   \else
  232.     \edef\grep@tag{\csname*grep*\endcsname}%
  233.     \def\grep@val{}%
  234.   \fi}
  235. \def\grep@splitlbuf#1:#2\sentinel{%
  236.   \edef\grep@tag{\csname*grep*#1*\endcsname}%
  237.   \def\grep@val{#2}}
  238. \def\fmfwizard{\fmfcmd{feynmfwizard := true;}}
  239. \def\fmfnowizard{\fmfcmd{feynmfwizard := false;}}
  240. \def\fmfshrink#1{\fmfcmd{shrink (#1);}}
  241. \def\endfmfshrink{\fmfcmd{endshrink;}}
  242. \def\fmfinit{\fmfcmd{vinit;}}
  243. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  244. \def\fmf#1#2{\fmfcmd{vconnect ("#1", #2);}}
  245. \def\fmfcyclen#1#2#3{\fmfcmd{vcyclen ("#1", #2, #3);}}
  246. \def\fmfrcyclen#1#2#3{\fmfcmd{vrcyclen ("#1", #2, #3);}}
  247. \def\fmfforce#1#2{\fmfcmd{vforce ((#1),#2);}}
  248. \def\fmfshift#1#2{\fmfcmd{vshift((#1),#2);}}
  249. \def\fmffixed#1#2{\fmfcmd{vconstraint ((#1), #2);}}
  250. \def\fmflabel#1#2{\fmfcmd{vlabel ("#1", #2);}}
  251. \def\fmfv#1#2{\fmfcmd{vvertex ("#1", #2);}}
  252. \def\fmfvn#1#2#3{\fmfcmd{vvertexn ("#1", #2, #3);}}
  253. \def\fmfblob#1#2{\fmfcmd{vblob ((#1),#2);}}
  254. \def\fmfdot#1{\fmfcmd{vdot (#1);}}
  255. \def\fmfblobn#1#2{\fmfcmd{vblobn (#1, #2);}}
  256. \def\fmfdotn#1#2{\fmfcmd{vdotn (#1, #2);}}
  257. \def\fmfleft#1{\fmfcmd{vleft(#1);}}
  258. \def\fmfright#1{\fmfcmd{vright(#1);}}
  259. \def\fmfbottom#1{\fmfcmd{vbottom(#1);}}
  260. \def\fmftop#1{\fmfcmd{vtop(#1);}}
  261. \let\fmfincoming\fmfleft
  262. \let\fmfoutgoing\fmfright
  263. \def\fmfsurround#1{\fmfcmd{vsurround(#1);}}
  264. \def\fmfleftn#1#2{\fmfcmd{vleftn(#1,#2);}}
  265. \def\fmfrightn#1#2{\fmfcmd{vrightn(#1,#2);}}
  266. \def\fmfbottomn#1#2{\fmfcmd{vbottomn(#1,#2);}}
  267. \def\fmftopn#1#2{\fmfcmd{vtopn(#1,#2);}}
  268. \let\fmfincomingn\fmfleftn
  269. \let\fmfoutgoingn\fmfrightn
  270. \def\fmfsurroundn#1#2{\fmfcmd{vsurroundn(#1,#2);}}
  271. \def\fmffor#1#2#3#4{\fmfcmd{for #1 = #2 step #3 until #4:}}
  272. \def\endfmffor{\fmfcmd{endfor}}
  273. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  274. \def\fmfposition{\fmfcmd{vposition;}}
  275. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  276. \def\fmfdraw{\fmfcmd{vdraw;}}
  277. \def\fmfL(#1,#2,#3)#4{\put(#1,#2){\makebox(0,0)[#3]{#4}}}
  278. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  279. \def\fmfdisplay{\fmfcmd{show_all_diagrams (100,100);}}
  280. \def\fmfstopdisplay{\fmfcmd{showstopping:=1;}\fmfdisplay}
  281. \mdqrestore
  282. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  283. \endinput
  284. %% 
  285. %% End of file `feynmf.sty'.
  286.